<template>
  <div class="Breadcrumb">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item v-for="(item,index) in breadcrumb" :key="index">
        <span v-if="item.to === ''">{{item.title}}</span>
        <router-link :to="item.to" v-if="item.to !== ''">
          {{item.title}}
        </router-link>
      </el-breadcrumb-item>
    </el-breadcrumb>
  </div>
</template>

<script>
export default {
  name: 'Breadcrumb',
  props: {
    breadcrumb: {
      type: Array,
      default: () => {
        return [
          { title: '全部分类', to: '' },
        ];
      }
    }
  }
}
</script>

<style lang="scss" src='./index.scss' scoped />